<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .block {
            width: 200px;
            height: 100px;
            background-color: brown;
            border-radius: 6px;
            margin-top: 20px;
            text-align: center;
            color: white;
            font-size: 30px;
            line-height: 100px;
        }
    </style>
</head>
<body>
<div class="block" onclick="showMsg()">弹窗</div>
<div class="block" onclick="takePhoto()">拍照</div>
<img id="myImg" style="width: 300px; height: 200px"/>
<script>
    function showMsg(){
        if(window.xiaochen){
            window.xiaochen.showToast("成功调用啦啦啦")
        }
    }
    function takePhoto(){
        if(window.xiaochen){
            window.xiaochen.takePhoto("getPhoto")
        }
    }
    function getPhoto(url){
        document.querySelector("#myImg").src = url
    }
</script>
</body>
</html>